import { createVNode, render } from "vue"

// 导入组件

import bindAreaDialog from "../components/bindArea/index.vue"


// 创建dom容器
const div = document.createElement("div")
div.setAttribute("class", "zl-area-dialog")
document.body.appendChild(div)

// 组件初始化
const openBindAreaDialog = () => {
  const vnode = createVNode(bindAreaDialog)
  render(vnode, div)
  // 弹窗显示时禁止滚动
  document.body.style.overflow = 'hidden'
}

// 关闭弹窗
const closeDialog = () => {
  // 移除弹窗组件并开启滚动
  render(null, div)
  document.body.style.overflow = ''
}

export {
  openBindAreaDialog,
  closeDialog
}
